home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2006 November
/
PCWorld_2006-11_cd.bin
/
v cisle
/
pcwdocl
/
pcwDocLnkCheck.exe
/
pcwDocLnkCheck.js
Wrap
Text File
|
2006-09-18
|
1KB
|
33 lines
var Fs = new ActiveXObject("Scripting.FileSystemObject");
var WshShell = WScript.CreateObject("WScript.Shell");
var recentdir = WshShell.SpecialFolders("Recent");
var f, fnum;
var i = 0;
var errlog = "";
f = Fs.GetFolder(recentdir);
fnum = new Enumerator(f.Files);
for (;!fnum.atEnd(); fnum.moveNext())
{
if (Fs.GetExtensionName(fnum.item()).toLowerCase() == 'lnk') {
fCheckLink(fnum.item());
}
}
if (i== 0 && errlog == "") {
WshShell.Popup("VÜichni zßstupci ve slo₧ce \"" + recentdir+ "\" jsou v po°ßdku.",0,"Skript PC WORLDu", 64);
}
else WshShell.Popup(i + "neplatn²ch odkaz∙ bylo odstran∞no ve slo₧ce \""+ recentdir + "\".\n" + errlog +"",0,"Skript PC WORLDu", 64);
function fCheckLink(pfad){
var oShellLink
try { oShellLink = WshShell.CreateShortcut(pfad);}
catch(err1){ errlog = errlog + pfad +"\ponechßno kv∙li chby∞jφcφm p°φstupov²m prßv∙m.\n"; }
if (!Fs.FileExists(oShellLink.TargetPath)) {
if (!Fs.FolderExists(oShellLink.TargetPath)) {
try { Fs.DeleteFile(pfad);i++}
catch(err2){ errlog = errlog + pfad +"\ponechßno kv∙li chby∞jφcφm p°φstupov²m prßv∙m.\n"; }
}
}
}